package com.igeek.d0618.test4;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

/**
 * @Author: zhiyu
 * @Date:17:57
 * @DESC:
 */
public class ReflectShow {
    public static void main(String[] args) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException {
        Class<Show> showClass = Show.class;
        Method show = showClass.getMethod("show", String.class);
        Show newInstance = showClass.newInstance();
        Object invoke = show.invoke(newInstance, "打印一个字符串");
    }
}
